package org.marsson.bNav;

import gnu.io.CommPortIdentifier;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Vector;

public class PortTest {
	
	private HashMap<String,CommPortIdentifier> hashMap = new HashMap<String,CommPortIdentifier>();
	Enumeration<CommPortIdentifier> pList = CommPortIdentifier.getPortIdentifiers();
	
	public PortTest(){
		CommPortIdentifier temp;
		while (pList.hasMoreElements()) {
			temp = pList.nextElement();
			hashMap.put(temp.getName(), temp);
		}
	}
	public CommPortIdentifier getPorts(String key) {
		return hashMap.get(key);
		
	
	}
	public Object[] getStrings() {
		return  hashMap.keySet().toArray();
	}
	
}
